package cn.learn.service.impl;

import cn.learn.domain.SysAccount;
import cn.learn.domain.SysPermission;
import cn.learn.mapper.SysLoginMapper;
import cn.learn.service.ISysLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * 用户登录的逻辑的实现
 * @author huangyezhan
 * @date 2020年01月02日12:09
 */
@Service
public class SysLoginServiceImpl implements ISysLoginService {
    @Autowired
    private SysLoginMapper sysLoginMapper;

    @Override
    public List<SysPermission> getAllPermissions() {
        return sysLoginMapper.getAllPermissions();
    }

    @Override
    public SysAccount getAccountByName(String accountName) {
        return sysLoginMapper.getAccountByName(accountName);
    }

    @Override
    public Set<SysPermission> getPermissionsByAccountId(Long accountId) {
        return sysLoginMapper.getPermissionsByAccountId(accountId);
    }

}
